package com.fesine.ch02.synchronizedOnThreadIn;

/**
 * @Author: Fesine
 * @CreateDate:2016/6/30
 * @UpdateUser:修改人名称
 * @UpdateDate:2016/6/30
 * @UpdateRemark:修改具体的内容
 */
public class ObjectService {
    public void serviceMehod() {
        synchronized (this) {
            try {
                System.out.println("begin time="+System.currentTimeMillis());
                Thread.sleep(2000);
                System.out.println("end time="+System.currentTimeMillis());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
